<?php
include_once '../Misc/Validation.php';
class UserRegView
{
	function CreateRegForm($msg)
	{
		$xhtml = "";

		$xhtml = "
		<form action='' method='post'>
			<ul class=''>
				<li class='reg-label'><label for='usrname' class='InputLabel'>Username:</label></li>

				<li class='form-input'><input type='text'class='InputBox' id='username' name='value[]'  /></li>

				<li class='reg-label'><label for='password' class='InputLabel'>Password:</label></li>

				<li class='form-input'><input type='text'class='InputBox' id='password' name='value[]'  /></li>

				<li class='reg-label'><label for='re_password' class='InputLabel'>Retype Password:</label></li>

				<li class='form-input'><input type='text'class='InputBox' id='re-password' name='value[]'  /></li>

				<li class='reg-label'><label for='email' class='InputLabel'>Email:</label></li>

				<li class='form-input'><input type='text'class='InputBox' id='email' name='value[]'  /></li>

				<li class='reg-label'><label for='re_email' class='InputLabel'>Retype Email:</label></li>

				<li class='form-input'><input type='text'class='InputBox' id='re-email' name='value[]'  /></li>

				<li><input type='submit' name='submit' value='Register'/></li>
				
			</ul>
		</form>";

		return $xhtml . $msg;
	}


	function GetFormData()
	{
		
		$retArray = array();


		foreach ($_POST['value'] as $value) 
		{
			array_push($retArray, $value);
		}

		return $retArray;

		
	}

	//Kollar om användaren klickat på submit knappen
    function TriedToSubmit()
    {
        if(isset($_POST['submit']))
        {
           return true;
        }
        else
        {
            return false;
        }
    }
}
